<?php
class Controller_Home extends Controller_Template
{
	public function __construct()
	{
		parent::__construct();
		$this->selfModel = new Model_MapperActualite("actualite", parent::$db);
	}
	
	public function index()
	{
		//récupère le nombre d'actualites dans la base
		$nbactualite = Model_TableActualite::count();
		//nombre d'actualite images
		$nbimages = Config::get_slot('home_max_actualites_image', 3);
		$nbsimples = Config::get_slot('home_max_actualites_simple', 15);
		
		$actualitesimage = $this->selfModel->getAll(0, $nbimages);
		$actualitessimple = $this->selfModel->getAll($nbimages, $nbsimples);
		header('Content-Type: text/html; charset=utf-8');
		
		require('view/home/index.php');
	}
}